<%@page import="entities.SiteConfig"%>
<%@page import="systems.ConfigSystem"%>
<%@page import="helpers.StringHelper"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.Map"%>
<%@page import="entities.MetaSeo"%>
<%@page import="java.util.TreeMap"%>
<%
SiteConfig siteConfig = ConfigSystem.getConfigs();
TreeMap check = (TreeMap) request.getAttribute("check");
TreeMap values = (TreeMap) request.getAttribute("values");
String success = (String) request.getAttribute("success");
MetaSeo metaseo = (MetaSeo) request.getAttribute("metaseo");

//Set content for Seo
Map<String, String> replates = new TreeMap<String, String>();
replates.put("__SERVER_NAME__", UrlHelper.getDomainServer(request));
replates.put("__SERVER_URL__", UrlHelper.getServerUrl(request));


String title = StringHelper.replateContent(metaseo.getTitle(), replates);
String description = StringHelper.replateContent(metaseo.getDescription(), replates);
String keywords = StringHelper.replateContent(metaseo.getKeywords(), replates);
String url = StringHelper.replateContent(metaseo.getOgurl(), replates);
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/templates/default/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="keywords" value="<%=keywords %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

	<script type="text/javascript" src="/templates/<%=siteConfig.getTemplate() %>/js/contact_us.js"></script>
		<div class="mainContent clearafter">
			<div class="leftMainContent">
			
				<!-- Content Tab -->
				<div class="content">
					<div class="content_in">
						
						<h1 class="page_title">Contact</h1>
						<div class="breadcrumbs">
							<p>
								<a href="/">Home</a> » Contact Us
							</p>
						</div>
						<div class="page_content">
							<p>If you have any questions, or comments and suggestions, please use the form below to contact us. Or you can mail to contact to us.</p>
							<div class="contact_form">
								<% if (success != null) { %>
								<p class="success_msg"><%=success %></p>
								<% } %>
								<form class="contact_form" method="post">
									<div class="form_row clearafter">
										<label>
											 Your Name
											<span class="indicates">*</span>
										</label>
										<input class="textfield" type="text" size="40" value="<%=values.get("name") != null ? values.get("name") : "" %>" name="name">
										<% if (check.get("name") != null ) { %>
										<span class="error_msg"><%=check.get("name") %></span>
										<% } %>
									</div>
									
									<div class="form_row clearafter">
										<label>
											 Email Address
											<span class="indicates">*</span>
										</label>
										<input class="textfield" type="text" size="40" value="<%=values.get("email") != null ? values.get("email") : "" %>" name="email">
										<% if (check.get("email") != null ) { %>
										<span class="error_msg"><%=check.get("email") %></span>
										<% } %>
									</div>
									
									<div class="form_row clearafter">
										<label>
											 Subject
											<span class="indicates">*</span>
										</label>
										<input class="textfield" type="text" size="40" value="<%=values.get("subject") != null ? values.get("subject") : "" %>" name="subject">
										<% if (check.get("subject") != null ) { %>
										<span class="error_msg"><%=check.get("subject") %></span>
										<% } %>
									</div>
									
									<div class="form_row clearafter">
										<label>
											 Message
											<span class="indicates">*</span>
										</label>
										<textarea class="textarea" rows="10" cols="40" name="content"><%=values.get("content") != null ? values.get("content") : "" %></textarea>
										<% if (check.get("content") != null ) { %>
										<span class="error_msg"><%=check.get("content") %></span>
										<% } %>
									</div>
									
									<div class="form_row clearafter">
										<label>
											 Captcha
											<span class="indicates">*</span>
										</label>
										<script>
								        	var RecaptchaOptions = { theme : 'clean' };
								  		</script>
										<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LeA0c4SAAAAAMsdjrB49GPol6XImTdJM2U2AHrF"></script>
										<% if (check.get("captcha") != null) { %>
											<span class="error_msg"><%=check.get("captcha")%></span>
										<% } %>
									</div>
									
									<input class="btn_green btn_spacer" type="submit" value="Send">
								</form>
							</div>
						</div>
						
					</div>
				</div>
				<!-- End Content tab -->
			</div>
			<jsp:include page="/templates/default/elements/right.jsp" />
		</div>
<jsp:include page="/templates/default/layouts/footer.jsp" />